// API相关类型定义

// 视频解析请求
export interface ParseVideoRequest {
  url: string
  platform?: 'douyin' | 'tiktok' | 'bilibili' | 'auto'
}

// 批量解析请求
export interface BatchParseRequest {
  urls: string[]
  platform?: 'douyin' | 'tiktok' | 'bilibili' | 'auto'
}

// 视频信息
export interface VideoInfo {
  id: string
  title: string
  author: string
  author_id?: string
  platform: string
  download_url: string
  original_url?: string
  cover_url: string
  duration?: number
  view_count?: number
  like_count?: number
  comment_count?: number
  share_count?: number
  create_time?: string
  description?: string
}

// API响应
export interface ApiResponse<T = any> {
  code: number
  message: string
  data?: T
}

// 错误响应
export interface ErrorResponse {
  code: number
  message: string
  detail?: string
}

// 平台信息
export interface PlatformInfo {
  name: string
  code: string
  enabled: boolean
  description: string
}

// 健康检查响应
export interface HealthResponse {
  status: string
  service: string
  version: string
  timestamp: string
}

// 服务统计
export interface ServiceStats {
  total_parsed: number
  success_count: number
  error_count: number
  success_rate: number
  avg_parse_time: number
  supported_platforms: number
}

// 解析状态
export type ParseStatus = 'idle' | 'parsing' | 'success' | 'error'

// 解析结果
export interface ParseResult {
  status: ParseStatus
  data?: VideoInfo
  error?: string
}